package com.cloudy.impl;

import java.io.IOException;
import java.io.OutputStream;


public class S3ObjectAsString extends S3Object {
	private Object content;
	private int contentLength;
	private String contentType;
	
	/* (non-Javadoc)
	 * @see com.cloudy.impl.S3ObjectI#getContentType()
	 */
	public String getContentType() {
		return contentType;
	}
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	public Object getContent() {
		return content;
	}
	public void setContent(Object content) {
		this.content = content;
	}
	public long getContentLength() {
		return contentLength;
	}
	/* (non-Javadoc)
	 * @see com.cloudy.impl.S3ObjectI#setContentLength(int)
	 */
	public void setContentLength(int contentLength) {
		this.contentLength = contentLength;
	}
	/* (non-Javadoc)
	 * @see com.cloudy.impl.S3ObjectI#getContentInBytes()
	 */
	public byte[] getContentInBytes() {
		return ((String)content).getBytes();
	}
	public void writeContentToOutPutStream(OutputStream outputStream) throws IOException {
		outputStream.write(getContentAsBytes());
		// TODO Auto-generated method stub
		
	}
	@Override
	protected byte[] getContentAsBytes() {
		return ((String)content).getBytes();
	}

}
